/** 
* Copyright (C) 2012-2017 ZEEI Inc.All Rights Reserved.
* 项目名称：pls
* 文件名称：WatPointServiceImpl.java
* 包  名  称：com.zeei.app.service.impl
* 文件描述：TODO 请修改文件描述
* 创建日期：2017年12月19日下午1:14:38
* 
* 修改历史
* 1.0 chenhuiqiong 2017年12月19日下午1:14:38 创建文件
*
*/


package com.zeei.app.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zeei.app.constant.PointConstant;
import com.zeei.app.dao.WatPointDao;
import com.zeei.app.service.WatPointService;
import com.zeei.app.vo.WatPointPolluteLimit;
import com.zeei.app.vo.WatPointPolluteLimitSpecial;
import com.zeei.app.vo.WatPolluteCountVO;
import com.zeei.app.vo.WaterPointListVO;

/** 
* 类型名称：WatPointServiceImpl
* 类型描述：废水排口信息管理
* 功能描述：废水排口信息管理
* 创建作者：chenhuiqiong
*
*/
@Service("watPointService")
public class WatPointServiceImpl implements WatPointService {

	@Autowired
	private WatPointDao watPointDao;
	/* (non-Javadoc)
	 * @see com.zeei.app.service.WatPointService#queryPointInfo(com.zeei.app.vo.WaterPointListVO)
	 */
	@Override
	public List<WaterPointListVO> queryPointInfo(WaterPointListVO waterPointListVO) {
		List<WaterPointListVO> waterPointList = new ArrayList<WaterPointListVO>();
		if(PointConstant.DIRECT_POINT.equals(waterPointListVO.getPointDirect())){
			waterPointList = watPointDao.queryDirectPointInfo(waterPointListVO);
		}else if(PointConstant.INDIRECT_POINT.equals(waterPointListVO.getPointDirect())){
			waterPointList = watPointDao.queryInDirectPointInfo(waterPointListVO);
		}else{
		    // 查询直接排口
		    waterPointList = watPointDao.queryDirectPointInfo(waterPointListVO);
		    // 查询间接排口
		    waterPointList.addAll(watPointDao.queryInDirectPointInfo(waterPointListVO));
		}
		return waterPointList;
	}
	
	/* (non-Javadoc)
	 * @see com.zeei.app.service.WatPointService#queryWatPointPolluteLimit(com.zeei.app.vo.WatPointPolluteLimit)
	 */
	@Override
	public List<WatPointPolluteLimit> queryWatPointPolluteLimit(WatPointPolluteLimit watPointPolluteLimit) {
	    List<WatPointPolluteLimit> polluteLimitLit = new ArrayList<WatPointPolluteLimit>();
	    if(watPointPolluteLimit.getPointDirect() == 0){
		polluteLimitLit = watPointDao.queryWatDirectPointPolluteLimit(watPointPolluteLimit);
	    }else if(watPointPolluteLimit.getPointDirect() == 1){
		polluteLimitLit = watPointDao.queryWatIndirectPointPolluteLimit(watPointPolluteLimit);
	    }else{
		 List<WatPointPolluteLimit> temp1 = watPointDao.queryWatDirectPointPolluteLimit(watPointPolluteLimit);
		 List<WatPointPolluteLimit> temp2 = watPointDao.queryWatIndirectPointPolluteLimit(watPointPolluteLimit);
		 polluteLimitLit.addAll(temp1);
		 polluteLimitLit.addAll(temp2);
	    }
	    
	    
	    return polluteLimitLit;
	}

	/* (non-Javadoc)
	 * @see com.zeei.app.service.WatPointService#queryWatPointPolluteLimitSpecial(com.zeei.app.vo.WatPointPolluteLimitSpecial)
	 */
	@Override
	public List<WatPointPolluteLimitSpecial> queryWatPointPolluteLimitSpecial(WatPointPolluteLimitSpecial watPointPolluteLimitSpecial) {
	    
	    List<WatPointPolluteLimitSpecial> polluteLimitSpecial = watPointDao.queryWatPointPolluteLimitSpecial(watPointPolluteLimitSpecial);
	    
	    return polluteLimitSpecial;
	    
	}

	/* (non-Javadoc)
	 * @see com.zeei.app.service.WatPointService#queryWatPointPolluteCount(com.zeei.app.vo.WatPolluteCountVO)
	 */
	@Override
	public List<WatPolluteCountVO> queryWatPointPolluteCount(WatPolluteCountVO watPolluteCountVO) {
	    
	    List<WatPolluteCountVO> watPolluteCountList = watPointDao.queryWatPointPolluteCount(watPolluteCountVO);
	    return watPolluteCountList;
	    
	}
	
	
	
}

